Skip to content

Compress contract configuration flags into a single storage slot - #744

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
YaronZaki:fix/issue-734-bitmask-config
Jul 29, 2026
Merged

Compress contract configuration flags into a single storage slot#744
mijinummi merged 1 commit into
MDTechLabs:mainfrom
YaronZaki:fix/issue-734-bitmask-config

Conversation

@YaronZaki

Copy link
Copy Markdown
Contributor

Summary

Packed six operational configuration booleans into a single bytes32 bitmask to replace six individual storage slots, reducing SLOAD and SSTORE gas costs.

Changes

  • Created contracts/config/BitmaskConfig.sol with bit-flag constants for each config option
  • Implemented Yul assembly getters/setters using AND, OR, XOR bitwise operators on a single bytes32 slot
  • All flags fit in one storage slot instead of six

Closes #734
Closes #735
Closes #733
Closes #732

Pack six operational flags (paused, locked, allowPublic, feeSwitch,
emergencyStop, upgradeable) into one storage word using bitwise
operators in Yul assembly.

Closes MDTechLabs#734
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@YaronZaki Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mijinummi
mijinummi merged commit 42a6af8 into MDTechLabs:main Jul 29, 2026
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants